//2009/09/07 23:14:13
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class Matching
{
public:
    vector <string> findMatch(vector <string> first, vector <string> second)
    {
        string state[4][3]=
        {
            {"CIRCLE","SQUIGGLE","DIAMOND"},
            {"RED","GREEN","BLUE"},
            {"SOLID","STRIPED","EMPTY"},
            {"ONE","TWO","THREE"}
        };
		vector<string> ret;
        for (int i=0; i<4; i++)
        {
			int temp = 0;
            for(int j=0; j<3; j++)
			{
				if(first[i] == state[i][j]) temp += j;
				if(second[i] == state[i][j]) temp += j;
			}
			ret.push_back(state[i][(6-temp)%3]);
        }
		return ret;
    }
};
